jst<-function(S,a,m,M,nu)
{
	p<-ncol(S)
	U<-rchisq(M,df=nu)
	L<-t(chol(S))
	X<-matrix(0,nrow=M)
	theta<-0
	k<-1
	for(i in 1:M)
	{
		X[i]<-.C("ghk_oneside", as.double(sqrt(nu/U[i])*L),as.double(a-m),as.double(rep(0,p)),as.integer(p),as.integer(k),res=as.double(theta))$res
	}
	return(log(mean(exp(X))))
}


